package jmine.tec.script;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum ScriptAPIMessages implements MessageCreator {

    ERROR_INTERRUPTED(0, "script.dispatcher.error.interrupted"),

    ERROR_EXECUTOR_NOTFOUND(1, "script.dispatcher.error.executor.notfound");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private ScriptAPIMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-script-api-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
